package br.com.etecmatao.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EntityManagerProvider {

    private static EntityManager entityManager;

    private EntityManagerProvider() {
    }

    public static EntityManager getEntityManager(){
        if(entityManager == null){
            EntityManagerFactory emf = Persistence.createEntityManagerFactory("EtecMataoPU");
            entityManager = emf.createEntityManager();
        }
        return entityManager;
    }

}
